home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / edit / teco.zip / PAGE.C < prev    next >
C/C++ Source or Header  |  1986-07-15  |  641b  |  26 lines

  1. #include <ctype.h>
  2. #include <stdio.h>
  3. #include <string.h>
  4. page() /* Push out this page, read next into buffer */
  5. {
  6. #include "teco.h"
  7.  
  8.     bufptx=0;            /* Initialize start */
  9.  
  10.     while (++bufptx <= bufptr) {    /* While work to do */
  11.         putc(buffer[bufptx],ot);/* Write out  char  */
  12.         if (ferror(ot)) {
  13.             fprintf(stderr,"?OUT, Output error\n\7");
  14.             clearerr(ot);
  15.         }
  16.     }
  17.     bufptr=0;            /* Buffer now empty */
  18.     bufptx=0;            /*  ..reset context */
  19.     if (feof(in)) {            /* No more to page  */
  20.         fprintf(stderr,"[Eof]\n");
  21.     } else {
  22.         append();        /* Append mt buffer */
  23.         if (buffer[bufptr]  == '\14') fprintf(stderr,"[Page]\n");
  24.     }
  25. }
  26.